#pragma once

#include <string>
#include <sstream>
#include <vector>

///////////////////////////////// string formatting //////////////////////////////
class StringFormater
{
public:
  StringFormater(std::string fmt) : m_fmt(fmt) {}

  template <class T>
  StringFormater & operator% (const T & param)
  {
    std::ostringstream os;
    os << param;
    m_params.push_back(os.str());
    return *this;
  }

  operator std::string() const;

private:
  std::string m_fmt;
  std::vector<std::string> m_params;
};

StringFormater format(std::string fmt);

///////////////////////////////// other stuff //////////////////////////////
inline float randf() { return (float)rand() / RAND_MAX; }

const double PI = 3.14159265358979323846;
